#pragma once 

#include "GLee.h"
#include <vector>

#import <OpenGL/gl.h>
#import <OpenGL/glext.h>
#import <OpenGL/glu.h>

#import "TagSourceController.h"

#include <AppKit/AppKit.h>


@interface BasicOpenGLView : NSOpenGLView
{
	// string attributes
	NSMutableDictionary * stanStringAttrib;
	CFAbsoluteTime msgTime; // message posting time for expiration
	
	NSTimer* timer;
 
    bool fAnimate;
	IBOutlet NSMenuItem * animateMenuItem;
    bool fInfo;
	IBOutlet NSMenuItem * infoMenuItem;
	bool fDrawHelp;
	bool fDrawCaps;
	
	
	IBOutlet TagSourceController * tagSourceController;
	
	
	IBOutlet NSSlider * sliderDistance_Value;
	IBOutlet NSSlider * sliderSize_Value;
	IBOutlet NSSlider * sliderTolerance_Value;
	IBOutlet NSSlider * sliderBorderMin_Value;
	IBOutlet NSSlider * sliderBorderMax_Value;
	
	IBOutlet NSTextField * sizeField;
	IBOutlet NSTextField * distanceField;
	IBOutlet NSTextField * toleranceField;

	NSOpenGLPixelFormat * fullScreenGLPixelFormat;
		
	CFAbsoluteTime time;
	
	bool tagsPulling;
	
}

+ (NSOpenGLPixelFormat*) basicPixelFormat;

- (void)goFullscreen;
- (void)goWindow;
- (void)toggleFullscreen;

-(IBAction) animate: (id) sender;
-(IBAction) info: (id) sender;




- (IBAction) btn_clearGrid:(id)sender;
- (IBAction) btn_clearVP:(id)sender;
- (IBAction) btn_create:(id)sender;
- (IBAction) btn_keywordToggle:(id)sender;
- (IBAction) btn_previewToggle:(id)sender;
- (IBAction) btn_updatePreview:(id)sender;
- (IBAction) btn_recycleSegmentToggle:(id)sender;
- (IBAction) btn_ignorePointsToggle:(id)sender;
- (IBAction) btn_saveXML:(id)sender;




- (IBAction) radio_background_white:(id)sender;
- (IBAction) radio_background_black:(id)sender;

- (IBAction) radio_points_random:(id)sender;
- (IBAction) radio_points_paint:(id)sender;
- (IBAction) radio_points_erase:(id)sender;

- (IBAction) slider_distance:(id)sender;
- (IBAction) slider_size:(id)sender;
- (IBAction) slider_tolerance:(id)sender;
- (IBAction) slider_borderMin:(id)sender;
- (IBAction) slider_borderMax:(id)sender;



- (void)keyDown:(NSEvent *)theEvent;
- (void)keyUp:(NSEvent *)theEvent;
- (void) mouseDown:(NSEvent *)theEvent;
- (void) rightMouseDown:(NSEvent *)theEvent;
- (void) otherMouseDown:(NSEvent *)theEvent;
- (void) mouseUp:(NSEvent *)theEvent;
- (void) rightMouseUp:(NSEvent *)theEvent;
- (void) otherMouseUp:(NSEvent *)theEvent;
- (void) mouseDragged:(NSEvent *)theEvent;
- (void) scrollWheel:(NSEvent *)theEvent;
- (void) rightMouseDragged:(NSEvent *)theEvent;
- (void) otherMouseDragged:(NSEvent *)theEvent;

- (void) mouseMoved:(NSEvent *)theEvent;

- (void)animationTimer:(NSTimer *)timer;
- (void) drawRect:(NSRect)rect;

- (void) update;		// moved or resized

- (BOOL) acceptsFirstResponder;
- (BOOL) becomeFirstResponder;
- (BOOL) resignFirstResponder;

- (id) initWithFrame: (NSRect) frameRect;
- (void) awakeFromNib;

@end


